<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
		<script src="../../script/mui.min.js"></script>
		<script src="../../script/jquery.min.js"></script>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" href="../../css/personal.css">
		<link rel="stylesheet" href="../../css/exam.css">
		<link rel="stylesheet" href="../../css/swiper-3.4.2.min.css">
		<title>老师端测验批改列表详情</title>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style>
			.pingfen  label ~
			input {
				float: left;
				width: 25%;
				height: 70%;
				padding: 8px 0px;
				margin-bottom: 0;
				padding-left: 0;
				border: 1px solid #d9d9d9;
			}
			.pingfen  label {
				font-family: 'Helvetica Neue', Helvetica, sans-serif;
				line-height: 1.1;
				vertical-align: middle;
				float: left;
				width: 19%;
				padding: 0.7em 0;
				padding-left: 0.8em;
				padding-right: 0.2em
			}
			.weui_mask {
				position: fixed;
				z-index: 998;
				top: 0;
				right: 0;
				bottom: 0;
				left: 0;
			}
			.weui_dialog {
				z-index: 999;
			}
			.swiper-wrapper {
				min-height: 400px
			}
			.Empty_title  .mui-checkbox input[type=checkbox]:checked, .Empty_title .mui-radio input[type=radio]:checked {
				border: 1px solid #333;
				background: 0 0;
			}
			.Empty_title  .mui-checkbox input[type=checkbox]:checked:before, .Empty_title .mui-radio input[type=radio]:checked:before {
				color: #333;
			}
			.questionItemImgDiv {
				height: 12em;
				width: 80%;
				max-height: 14em;
				max-width: 95%;
				margin-left: 13px;
			}
			.xuanzeImgDiv {
				width: 80%;
				height: 8em;
				max-height: 10em;
			}
			.tiankong {
				font-family: inherit;
				border-bottom: 1px solid #000;
				margin: 0 8px;
				text-align: center;
				width: auto;
				/*word-break:break-all*/
			}
			.question_video_div {
				padding: 10px 10px;
				padding-left: 20px;
			}
			.question_video_div	video {
				width: 100%;
				height: 13em;
				background-color: black;
			}
			.question_video_div	img {
				width: 100%;
				height: 10em;
				background-color: black;
			}
			.option_video_div {
				padding: 10px 10px;
				padding-left: 55px;
			}
			.option_video_div	img {
				width: 100%;
				height: 8em;
				background-color: black;
			}
			.option_video_div	video {
				width: 100%;
				height: 12em;
			}
			table {
				border: 1px solid #ccc;
				border-collapse: collapse;
				border-spacing: 0;
			}
			td, th {
				border: 1px solid #ccc;
				padding: 0;
				text-align: center;
				color: #000000
			}
			.analysisdiv img {
				width: 100%
			}
		</style>
	</head>
	<body >
		<div class="stu-test" id="scroll">
			<div class="base_style_color" id='BarAppearance' ></div>
			<div class="base_navigation_bar base_style_color base_navigation_item_bar" >
				<a class="base_left_item" href="#" onclick="backTestToast()"> <img class="base_back_icon"  src="../../image/icon_jiantou.png" alt=""> </a>
				<span id="title"></span>
			</div>
			<div class="space10"></div>
			<div class="k-con-border qusetion-type" >
				<div class="k-con-part" style="position: static">
					<p class="k-text-center k-c323 k-f12">
						<span class="test-score-detail "> 试卷分数：<span class="k-cred" id="score"></span>分 </span>
						<span class="test-score-detail"> 通过分数：<span class="k-cred" id="passscore"></span>分 </span>
						<span class="test-score-detail"> 考试时间：<span class="k-cred" id="kstime"></span>分 </span>
					</p>
				</div>
			</div>
			<div class="k-con test-m-bottom70 test-analysis" id="question_div">
				<div class="swiper-container">
					<div class="swiper-wrapper" ></div>
				</div>
			</div>
			<div class="k-con1 k-text-center k-fixed-bottom test-bottom1" id="sub_bt">
				<div class="k-con-part1">
					<button id="sub_bt_div"   type="button" class="mui-btn mui-btn-primary " onclick="CheckSubmit()" style="text-align: center;" >
						提交
					</button>
					<div class="test_card_div">
						<a class="base_right_item "style="color: #18B4ED" href="#popover-card">答题卡 </a>
					</div>
				</div>
			</div>
			<div id="popover-card" class="mui-popover test-num-card" style=" width: 97% ;">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll" id="scroll-card"></div>
				</div>
			</div>
			<div id="offlineAlert" class="weui_dialog_confirm" style="display: none;">
				<div class="weui_mask"></div>
				<div class="weui_dialog" >
					<div class="weui_dialog_hd">
						<strong class="weui_dialog_title" id="checkNum"></strong>
					</div>
					<div class="weui_dialog_bd"></div>
					<div class="weui_dialog_ft">
						<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default"  style="color:#18b4ed">取消</a>
						<a onclick="cleanConfirm()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
					</div>
				</div>
			</div>
			<div class="weui_dialog_alert" id="closeAlert" style="display: none;">
				<div class="weui_mask"></div>
				<div class="weui_dialog" >
					<div class="weui_dialog_hd">
						<strong class="weui_dialog_title" id="checkNum2"></strong>
					</div>
					<div class="weui_dialog_ft">
						<a onclick="Cancel()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/swiper-3.4.2.jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/TestUi.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/attachmentManager.js"></script>
	<script type="text/javascript" src="../../script/ui.js"></script>
	<script type="text/javascript">
		var daan = new Object();
		//题目名称数组
		var itemNameArr = new Array();
		var pid = "";
		// 计划id
		var cid = "";
		//课程id
		var chapterid = "";
		//章节id
		var tid = "";
		var stime = "";
		var json_jieguo = new Object();
		var Subjective_questionLen = '';
		var Objective_questionLen = '';
		var questionLen = '';
		var qidArr = new Array();
		var clickNum = "";
		apiready = function() {
			initHeaderUI();
			if (api.pageParam.type == 0) {//mocc
				sendBuriedNotifi('0', 'MOOC测验老师批阅页', '015');
			} else {
				sendBuriedNotifi('0', '自由课程测验老师批阅页', '058');
			}
			var h = api.winHeight * 0.3;
			$('#popover-card').css('height', h);
			var pageParam = api.pageParam;
			$('#title').text(api.pageParam.rename);
			showProgress();
			scrollUI();
			//获取数据
			loadData();
			// 滚动监听
			listenScroll();
			kebackListen()
		}
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				vid : api.pageParam.vid,
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		//自由课程获取已提交测验信息
		function loadData() {
			var params = {
				cuid : api.pageParam.cuid,
				jid : $api.getStorage('cfnetppjxid'),
				tid : api.pageParam.tid,
				vid : api.pageParam.vid,
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				cjid : api.pageParam.cjid,
			};

			cfnetppPOST(url_getTestScoreList, params, true, function(data, status) {
				api.hideProgress();
				if (status == 'success') {
					if (data.status == 1) {
						var jsonData = data.data;
						var classDatas =JSON.parse(jsonData.timudetail);
						$('#passscore').text(jsonData.passscore);
						$('#kstime').text(jsonData.elapse);
						$('#score').text(numNull(jsonData.testscore));
						if (classDatas != null && classDatas != '') {
							GetHtmlTestList(classDatas);
						} else {
							back('题目为空');
						}
					} else {
						api.toast({
							msg : '网络异常,获取题目失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '网络异常,获取题目失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//创建相应题目id对应的对象
		function setUpObject(data) {
			var questions = data;
			for (var i = 0; i < questions.length; i++) {
				var question = questions[i];
				//子问题数组
				if (question.qtype == '4' || question.qtype == '10' || question.qtype == '5') {//论述题
					qidArr.push(question.qid);
					//取出子题目
					daan[question.qid] = new Array();
				}
			}
		}

		//删除未回答的题目数组
		function DeleteAnswerNullData() {
			for (var k = 0; k < qidArr.length; k++) {
				if ( typeof daan[qidArr[k]] == 'string') {
					if (daan[qidArr[k]] == null || daan[qidArr[k]] == "" || daan[qidArr[k]] == undefined) {
						delete daan[qidArr[k]];
					}
				} else if ( typeof daan[qidArr[k]] == 'object') {
					if ( typeof daan[qidArr[k]].length == 'number') {
						if (daan[qidArr[k]].length == 0) {
							delete daan[qidArr[k]];
						}
					}
				}
			}
		}

		//拼接题目数组
		function GetHtmlTestList(list) {

			var data = list;
			var dataArr = new Array();
			var subjectiveArr = new Array();
			var objectiveArr = new Array();
			var danduopaneArr = new Array();
			var danArr = new Array();
			var duoArr = new Array();
			var panArr = new Array();
			var shituArr = new Array();
			var paixuArr = new Array();
			var shipinArr = new Array();
			var lunshuArr = new Array();
			var anliArr = new Array();
			var chuanArr = new Array();
			if (data != null && data != '') {
				if (data.dan != undefined && data.dan.length > 0 && data.dan != '' && data.dan != null) {
					for (var i = 0; i < data.dan.length; i++) {
						var weeklyData = data.dan[i];
						danArr.push(weeklyData);
					}
				}
				if (data.duo != undefined && data.duo.length > 0 && data.duo != '' && data.duo != null) {
					for (var i = 0; i < data.duo.length; i++) {
						var duoData = data.duo[i];
						duoArr.push(duoData);
					}
				}
				if (data.pan != undefined && data.pan.length > 0 && data.pan != '' && data.pan != null) {
					for (var i = 0; i < data.pan.length; i++) {
						var panData = data.pan[i];
						panArr.push(panData);
					}
				}
				if (data.lunshu != undefined && data.lunshu.length > 0 && data.lunshu != '' && data.lunshu != null) {
					for (var i = 0; i < data.lunshu.length; i++) {
						var lunshuData = data.lunshu[i];
						lunshuArr.push(lunshuData);
					}
				}
				if (data.shitu != undefined && data.shitu.length > 0 && data.shitu != '' && data.shitu != null) {
					for (var i = 0; i < data.shitu.length; i++) {
						var shituData = data.shitu[i];
						shituArr.push(shituData);
					}
				}
				if (data.paixu != undefined && data.paixu.length > 0 && data.paixu != '' && data.paixu != null) {
					for (var i = 0; i < data.paixu.length; i++) {
						var paixuData = data.paixu[i];
						paixuArr.push(paixuData);
					}
				}
				if (data.shipin != undefined && data.shipin.length > 0 && data.shipin != '' && data.shipin != null) {
					for (var i = 0; i < data.shipin.length; i++) {
						var shipinData = data.shipin[i];
						shipinArr.push(shipinData);
					}
				}
				if (data.anli != undefined && data.anli.length > 0 && data.anli != '' && data.anli != null) {
					for (var i = 0; i < data.anli.length; i++) {
						var anliData = data.anli[i];
						anliArr.push(anliData);
					}
				}
				if (data.chuan != undefined && data.chuan.length > 0 && data.chuan != '' && data.chuan != null) {
					for (var i = 0; i < data.chuan.length; i++) {
						var chuanData = data.chuan[i];
						chuanArr.push(chuanData);
					}
				}
				dataArr = dataArr.concat(lunshuArr, chuanArr, anliArr, danArr, duoArr, panArr, shituArr, paixuArr, shipinArr);
				subjectiveArr = subjectiveArr.concat(danArr, duoArr, panArr, shituArr, paixuArr, shipinArr);
				objectiveArr = objectiveArr.concat(lunshuArr, chuanArr, anliArr);
				SetUI(dataArr, subjectiveArr, objectiveArr);
			}
			if (objectiveArr.length == 0) {
				document.getElementById("sub_bt_div").style.visibility = "hidden";
			}
		}

		// 滚动监听
		function listenScroll() {
			var winHeight = $(window).height();
			//获取当前页面高度
			$(window).resize(function() {
				var thisHeight = $(this).height();
				if (winHeight - thisHeight > 50) {
					//当软键盘弹出，在这里面操作
					$("#sub_bt").css('display', 'none');
				} else {
					$("#sub_bt").css('display', 'block');
					//当软键盘收起，在此处操作
				}
			});
		}

		//input只能输入数字
		function onlyNum(obj, score) {
			var str = score;
			if (obj.value > str) {
				obj.value = str;
			}
		}

		//得到论述题评分数据
		function getLunShuItemScore(slideNumber) {
			var duoObject = new Object();
			//单选题tiid
			var lunshuQuestionid = "";
			var Itemindex = '';
			//论述题id
			var duoQuestionidArr = new Array();
			var lunshuContentScore = "";
			var lunshuScore = '';
			//学生实际得分
			var itemFenshu = '';
			//题目分数
			var itemtype = $(".swiper-wrapper").children().eq(slideNumber).attr('itemtype');
			//获取题目类型
			if (itemtype == '4' || itemtype == '10' || itemtype == '5') {
				$(".swiper-wrapper").children().eq(slideNumber).find('input').on('input', function() {
					lunshuQuestionid = $(this).attr('itemid');
					//题目id
					itemFenshu = parseInt($(this).attr('itemscore'));
					//题目分数
					var score = $(this).val();
					Itemindex = slideNumber - Subjective_questionLen;
					//当前题目角标
					if (!isEmpty(score)) {//分数不为空
						$("#objective_item_card").find("span").eq(Itemindex).removeClass('qusetion-num').addClass('qusetion-selected');
						if (isDecimal(score)) {//小数
							lunshuContentScore = parseFloat(score).toFixed(1);
							//老师实际评分
						} else {//整数
							lunshuContentScore = parseInt(score);
						}
						if (lunshuContentScore > itemFenshu) {
							lunshuScore = itemFenshu;
						} else {
							lunshuScore = lunshuContentScore;
						}
						daan[lunshuQuestionid] = lunshuScore.toString();
					} else {
						$("#objective_item_card").find("span").eq(Itemindex).removeClass('qusetion-selected').addClass('qusetion-num');
						daan[lunshuQuestionid] = "";
					}
				});
			}
		}

		//拼接html字符串
		function SetUI(list, subjectiveArr, objectiveArr) {

			var qxuan = '';
			var data = list;
			var questionStr = "";
			var xuanzeStr = "";
			var qdaanStr = "";
			setUpObject(data);

			Subjective_questionLen = subjectiveArr.length;
			Objective_questionLen = objectiveArr.length;
			questionLen = data.length;
			popoverCardNum(questionLen);

			for (var i = 0; i < questionLen; i++) {
				console.log(JSON.stringify(data[i] ));
				if (data[i] != null && data[i] != '') {
					try {
						qxuan = ArrayIsNull(JSON.parse(data[i].qxuanxiang));
					}catch (e) {

					}
					if (data[i].hasOwnProperty('dtjieguo')) {
						$(".swiper-wrapper").append('<div class="swiper-slide" id="item' + (i + 1) + '" itemtype="' + data[i].qtype + '"></div>')
						questionStr = questionsImgIsNull(data[i].questions);
						if (data[i].qtype == 1 || data[i].qtype == 3 || data[i].qtype == 8) {
							if (data[i].dtjieguo == data[i].qdaan) {//答案正确
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-true');
							} else if (data[i].dtjieguo == "" || data[i].dtjieguo == null) {
								qdaanStr = '<p class="k-cred left_10">' + "未答题" + '</p>'
							} else {
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-false');
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
							}
							$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + ByIdGetQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + (i + 1 - Objective_questionLen) + "、" + "(" + data[i].qfenshu + "分)" + questionStr + '</p>' + qdaanStr + '<div class="test-answer-list left_15" >' + '</div>' + '</div>' + '<div class="mui-input-row "style="margin-top: 23px">' + '</div>')
							//	是单选或判断
							for (var k = 0; k < qxuan.length; k++) {
								var xuanzeStr1 = data[i].qtype != 3 ? qxuan[k].xuanzhe : panxuanzeReturnStr(k);
								xuanzeStr = xuanzheImgIsNull(xuanzeStr1);
								if (data[i].dtjieguo != "" && data[i].dtjieguo != null) {
									if ((k + 1 ) != charCodeAt(data[i].dtjieguo)) {
										$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left " >' + xuanzeStr + '<input dataindex="' + (k + 1) + '"  onclick="return false;"   name="radio' + data[i].qid + '" type="radio"   itemid="' + data[i].qid + '">' + '</div> ')
									} else {
										$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left " >' + xuanzeStr + '<input dataindex="' + (k + 1) + '"  checked="checked"  onclick="return false;"   name="radio' + data[i].qid + '" type="radio"   itemid="' + data[i].qid + '" checked="checked" >' + '</div> ')
									}
								} else {
									$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left Empty_title" >' + xuanzeStr + '<input dataindex="' + (k + 1) + '"    onclick="return false;"   name="radio' + data[i].qid + '" type="radio"    >' + '</div> ')
								}
							}
						} else if (data[i].qtype == 2 || data[i].qtype == 9) {
							var qdaanArr = strIsNullSpite(data[i].qdaan);
							var jsonObject1 = numIsNullSpite(data[i].dtjieguo);
							if (jsonObject1.toString() == qdaanArr.toString()) {//答案正确
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-true');
							} else if (jsonObject1.toString() == "" || jsonObject1.toString() == null) {
								qdaanStr = '<p class="k-cred left_10">' + "未答题" + '</p>'
							} else {
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-false');
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
							}
							$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + ByIdGetQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + (i + 1 - Objective_questionLen) + "、" + "(" + data[i].qfenshu + "分)" + questionStr + '</p>' + qdaanStr + '<div class="test-answer-list left_15" >' + '</div>' + '</div>' + '<div class="mui-input-row "style="margin-top: 23px">' + '</div>')
							//	是多选
							for (var k = 0; k < qxuan.length; k++) {
								xuanzeStr = xuanzheImgIsNull(qxuan[k].xuanzhe);
								if (charCodeAt(jsonObject1.toString()).toString().indexOf(k + 1) == -1) {
									$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + xuanzeStr + '<input dataindex="' + (k + 1) + '" name="checkbox1"  onclick="return false;"    value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')
								} else {
									$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + xuanzeStr + '<input dataindex="' + (k + 1) + '"  checked="checked"   onclick="return false;"  name="checkbox1" value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')
								}
							}
						} else if (data[i].qtype == 4 || data[i].qtype == 10) {
						 
							var qdaanStr = '<div class="k-cred left_10 analysisdiv">' + '正确答案:' + judgeAnswer(data[i].qjiexi) + '</div>'
							$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + ByIdGetQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + (i + 1 + Subjective_questionLen) + "、" + "(" + data[i].qfenshu + "分)" + questionStr + '</p>' + qdaanStr + '<div class="test-answer-list left_15" >' + '</div>' + '</div>' + '<div class="mui-input-row pingfen" style="margin-top: 23px;margin-left: 0.3rem">' + '<label>评分:' + '</label>' + '<input type="number"  id="grade" onkeyup="onlyNum(this,' + data[i].qfenshu + ')" itemid="' + data[i].qid + '"  itemscore="' + data[i].qfenshu + '" onclick="getLunShuItemScore(' + i + ')" >' + '</div>')
							// 论述
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="test-answer-list">' + '<textarea  class="k-texttarea k-f14" readonly="readonly"    id="content" itemid="' + data[i].qid + '">' + dtjieguoIsNull(data[i].dtjieguo) + '</textarea>' + '</div>')
						} else if (data[i].qtype == 7) {//识图题
							var qdaanArr = strIsNullSpite(data[i].qdaan);
							var jsonObject1 = numIsNullSpite(data[i].dtjieguo);
							var userchooseLetter = [];
							var shituxuanzeStr = '';
							if (jsonObject1 != '' && jsonObject1 != null) {
								for (var j = 0; j < jsonObject1.length; j++) {
									userchooseLetter.push(charCodeAt(jsonObject1[j]))
								}
							} else {
								userchooseLetter = ['无'];
							}
							if (jsonObject1.toString() == qdaanArr.toString()) {//答案正确
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-true');
							} else if (jsonObject1.toString() == "" || jsonObject1.toString() == null) {
								qdaanStr = '<p class="k-cred left_10">' + "未答题" + '</p>'
							} else {
								$("#scroll-card").find("span").eq(i - Objective_questionLen).removeClass('qusetion-num-normal').addClass('qusetion-num-false');
								qdaanStr = '<p class="k-cred left_10">' + "正确答案:" + data[i].qdaan + '</p>'
							}
							$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + ByIdGetQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + (i + 1 - Objective_questionLen) + "、" + "(" + data[i].qfenshu + "分)" + questionStr + '</p>' + qdaanStr + '<div class="test-answer-list left_10"  itemtype="' + data[i].qtype + '">' + '</div>' + '</div>')
							for (var k = 0; k < qxuan.length; k++) {
								xuanzeStr = xuanzheImgIsNull(qxuan[k].xuanzhe);
								if (userchooseLetter.toString().indexOf(k + 1) == -1) {
									$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + xuanzeStr + '<input  Itemindex="' + i + '" dataindex="' + (k + 1) + '" name="checkbox1"   onclick="return false;" value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')
								} else {
									$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + xuanzeStr + '<input  Itemindex="' + i + '" dataindex="' + (k + 1) + '"  checked="checked"   name="checkbox1"   onclick="return false;"    value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')//
								}
							}
						} else if (data[i].qtype == 5) {//上传题
							$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + ByIdGetQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + (i + 1 + Subjective_questionLen) + "、" + "(" + data[i].qfenshu + "分)" + questionStr + '<p class="k-cred left_10">' + "移动端暂不支持上传题,请在PC端查看！" + '</p>' + '</p>' + '<div class="test-answer-list left_10"  onclick="return false;" itemtype="' + data[i].qtype + '">' + '</div>' + '<div class="mui-input-row pingfen" style="margin-top: 23px;margin-left: 0.3rem">' + '<label>评分:' + '</label>' + '<input type="number"  id="grade" onkeyup="onlyNum(this,' + data[i].qfenshu + ')" itemid="' + data[i].qid + '"  itemscore="' + data[i].qfenshu + '" onclick="getLunShuItemScore(' + i + ')" >' + '</div>')
						} else {
						}
					} else {
						back('此测验学生没有相关提交结果');
					}
				} else {
					$(".swiper-wrapper").append('<div class="mui-slider-item" id="item' + (i + 1) + '"  ></div>')
					$("#item" + (i + 1)).append('<div class="k-con-part clearfix tont" >' + '<p class="k-f16 k-c323 k-mt15">' + (i + 1) + "、" + '本题为空' + '</p>' + '<div  class="test-answer-list"      onclick="GetAnswerData(' + i + ')" >' + '</div>' + '</div>')
				}
			}
			var mySwiper = new Swiper('.swiper-container', {
				autoHeight : true,
				//					autoplay: 2000,//可选选项，自动滑动
				//用户操作swiper之后，是否禁止autoplay
				autoplayDisableOnInteraction : true,
				//				pagination : '.swiper-pagination',
				direction : 'horizontal',
				loop : false,
			})
			// 点击答题卡切换
			$("#popover-card span").on("click", function() {
				//				gallery.slider().gotoItem($(this).index())
				var index = $(this).index();
				if (Objective_questionLen == 0) {
					mySwiper.slideTo($(this).index())
				} else {
					if ($(this).index() > Subjective_questionLen - 1) {
						mySwiper.slideTo(($(this).index() - Subjective_questionLen))
					} else {
						mySwiper.slideTo(($(this).index() + Objective_questionLen))
					}
				}
				mui('#popover-card').popover('hide')
			});
		}

		//判断答案是否为空
		function judgeAnswer(str) {
			if (!isEmpty(str)) {
				return htmlDecodeByRegExp(str);
			} else {
				return '暂无'
			}
		}

		//提交批改数据
		function SubmitData() {
			var param = {
				jid : $api.getStorage('cfnetppjxid'),
				uid : $api.getStorage('cfnetppuid'),
				vid : api.pageParam.vid,
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				cuid : api.pageParam.cuid,
				cjid : api.pageParam.cjid,
				sorce : daan,
				message : api.pageParam.rename + '的测验'
			};
			cfnetppPOST(url_teachSubTest, param, false, function(data, status) {
				hideProgress();
				if (api.pageParam.type == 0) {//mocc
					SendBusinessOperationsLogNotifi('Mocc课程测验老师批阅页', '015', param, param, '', data, 'Mocc课程老师批改测验提交接口', '015-01')
				} else {
					SendBusinessOperationsLogNotifi('自由课程测验老师批阅页', '058', param, param, '', data, '自由课程老师批改测验提交接口', '058-01')
				}
				if (status == 'success') {
					if (data.code == 200) {
						ShowToast('批改成功');
						sendNotifi();
						api.closeWin({
						});
					} else if (data.code == 101) {
						back('该测验已经审阅完成');
					} else {
						api.toast({
							msg : '批改失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '批改失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//发送相应通知到列表
		function sendNotifi() {
			api.sendEvent({
				name : 'RefreshTestListNotifi'
			});
		}

		//退出考试提示
		function backTestToast() {
			if (api.pageParam.type == 0) {//mocc
				sendBuriedNotifi('1', 'MOOC测验老师批阅页', '015');
			} else {
				sendBuriedNotifi('1', '自由课程测验老师批阅页', '058');
			}
			if (clickNum == 3) {
				api.closeWin({
				});
			} else {
				$("#checkNum").text("是否确定退出批改?");
				$('#offlineAlert').show();
				clickNum = 2;
			}
		}

		//检查题目是否提交
		function CheckSubmit() {
			DeleteAnswerNullData();
			var daanLen = ObjectCount(daan);
			var strLen = Objective_questionLen - daanLen;
			if (strLen == 0) {
				clickNum = 1;
				$("#checkNum").text("是否确定提交批改结果？");
				$('#offlineAlert').show();
			} else {
				clickNum = 4;
				$("#checkNum2").text("您还有" + strLen + "道题未批改,请批改完成后再提交!");
				$('#closeAlert').show();
			}
		}

		//点击取消
		function cleanCancel() {
			$('#offlineAlert').hide();
		}

		//点击确定
		function cleanConfirm() {
			$('#offlineAlert').hide();
			if (clickNum == 1) {
				showProgress();
				DeleteAnswerNullData();
				SubmitData();
			} else if (clickNum == 2) {
				backClick();
			}
		}

		function kebackListen() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				//coding...
				backTestToast();
			});
		}

		//	生成答题卡题号
		function popoverCardNum(questionLen) {
			for (var i = 0; i < questionLen; i++)
				$("#scroll-card").append('<span class=" qusetion-num-normal">' + (i + 1) + '</span>')
		}
	</script>
</html>